<?php
/**
 * exception header template
 * @author bbqq <toughgamer@gmail.com>
 * @package com.blib.core
 * @copyright bbqq qstufie.com
 */
if (empty($arg) || !$arg instanceof Exception) {
    exit;
}
?>
<style media="screen" type="text/css"><!--
<?php include_once _BLIBPATH . '_templates/style/internal.css'; ?>
--></style>
<h3 class="_blib_internal_css">Exception <?php get_class($arg); ?> </h3>
<table class="_blib_internal_css" border="0" cellpadding="0" cellspacing="1">
<tr><th>message</th><td><?php echo $arg->getMessage() ?></td></tr>
<tr><th>file</th><td><?php echo $arg->getFile() ?></td></tr>
<tr><th>code</th><td><?php echo $arg->getCode() ?></td></tr>
<tr><th>line</th><td><?php echo $arg->getLine() ?></td></tr>
<?php
// is it Blib_Exception_Dao?
if ($arg instanceof Blib_Exception_Dao) {
?>
    <tr><th>sql</th><td><?php echo $arg->getSql(); ?></td></tr>
    <tr><th>bind</th><td><?php var_dump($arg->getBind()); ?></td></tr>
    <?php
    foreach ($arg->getTrace() as $k => $trace) {
    ?>
        <tr><th colspan="2">Trace #<?php echo $k + 1; ?></th></tr>
        <?php
        foreach ($trace as $n => $v) {
        ?>
            <tr><th><?php echo $n; ?></th><td><?php var_dump($v); ?></td></tr>
        <?php
        }
    }
}
?>
</table>